package dao;
import java.sql.*;

import org.apache.tomcat.dbcp.dbcp.BasicDataSource;




public class daoKonekcija {
private static final String Driver= "com.mysql.jdbc.Driver";
private static final String DBURL= "jdbc:mysql://localhost:3306/mydb";
private static final String dbuser= "root";
private static final String dbpass= "";    
private static final BasicDataSource PoolKonekcija = new BasicDataSource();

static {
	
	PoolKonekcija.setUrl(DBURL);
	PoolKonekcija.setDriverClassName(Driver);
	PoolKonekcija.setUsername(dbuser);
	PoolKonekcija.setPassword(dbpass);
	PoolKonekcija.setMaxActive(-1);
	PoolKonekcija.setMaxIdle(-1);
	PoolKonekcija.setMaxWait(-1);

}

public synchronized static Connection dajKonekciju() throws SQLException
{
	return PoolKonekcija.getConnection();
}

}



